#include "regwindows.h"
#include "ui_regwindows.h"
#include "mainwindow317.h"
#include "mysqlqt.h"

RegWindows::RegWindows(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::RegWindows)
{
    ui->setupUi(this);
}

RegWindows::~RegWindows()
{
    delete ui;
}

void RegWindows::GetUserPut()
{
    MySqlQt sql = MySqlQt();
    QString name = ui->NameLine->text().trimmed();
    QString paw = ui->PawLine->text().trimmed();
    // TODO : mysql
    QSqlDatabase db = sql.db;
    sql.ConnectSql(db);
    sql.InsertUserName(db,name,paw);
}

void RegWindows::on_LogButton_clicked()
{
    GetUserPut();
    this->close();
    MainWindow* main = new MainWindow();
    main->show();
}

